using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace vtpsms.dao.Models.Mapping
{
    public class CUSTOMER_GROUPMap : EntityTypeConfiguration<CUSTOMER_GROUP>
    {
        public CUSTOMER_GROUPMap()
        {
            // Primary Key
            this.HasKey(t => new { t.CustomerId, t.GroupId });

            // Properties
            this.Property(t => t.CustomerId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.GroupId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("CUSTOMER_GROUP");
            this.Property(t => t.CustomerId).HasColumnName("CustomerId");
            this.Property(t => t.GroupId).HasColumnName("GroupId");
        }
    }
}
